home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_24_Next-Previous Photo Button.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.6 KB  |  64 lines

  1. property pDirection, pIncludeRolloverState, ancestor
  2. global gCurrentPhoto, gMasterPhotos
  3.  
  4. on beginSprite me
  5.   if pIncludeRolloverState then
  6.     set numTrans to 3
  7.   else
  8.     set numTrans to 2
  9.   end if
  10.   set togSty to 0
  11.   set ancestor to new(script "Bitmap But 1", the spriteNum of me, numTrans, togSty)
  12. end
  13.  
  14. on MouseUpAction me
  15.   repeat with n = 1 to count(gMasterPhotos)
  16.     if getAt(gMasterPhotos, n) = gCurrentPhoto then
  17.       exit repeat
  18.     end if
  19.   end repeat
  20.   if pDirection = #next then
  21.     set n to n + 1
  22.   else
  23.     set n to n - 1
  24.   end if
  25.   if n > count(gMasterPhotos) then
  26.     set n to 1
  27.   end if
  28.   if n < 1 then
  29.     set n to count(gMasterPhotos)
  30.   end if
  31.   set newName to getAt(gMasterPhotos, n)
  32.   set gCurrentPhoto to newName
  33.   sendAllSprites(#UpdateDetail, #photo)
  34.   sendAllSprites(#UpdateWhatItShows)
  35. end
  36.  
  37. on MouseEnterAction me
  38.   nothing()
  39. end
  40.  
  41. on MouseLeaveAction me
  42.   nothing()
  43. end
  44.  
  45. on getPropertyDescriptionList me
  46.   set description to [:]
  47.   addProp(description, #pDirection, [#default: #next, #format: #symbol, #comment: "Direction", #range: [#next, #previous]])
  48.   addProp(description, #pIncludeRolloverState, [#default: 1, #format: #boolean, #comment: "Include Rollover State"])
  49.   return description
  50. end
  51.  
  52. on getBehaviorDescription me
  53.   set endChar to offset("--END OF HEADER", the text of me)
  54.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  55.   set description to line 1 to endLine of the text of me
  56.   repeat with whichLine = endLine down to 1
  57.     if line whichLine of description = EMPTY then
  58.       delete line whichLine of description
  59.     end if
  60.   end repeat
  61.   delete line 1 of description
  62.   return description
  63. end
  64.